<template>
  <div class="titletopXX">
    <van-nav-bar
      v-if="name == '扫码核销'"
      :title="name"
      left-arrow
      @click-left="goHome"
      :fixed="true"
    >
      <template #left>
        <van-icon color="#606266" name="wap-home" size="30" />
      </template>
    </van-nav-bar>
    <!-- <van-nav-bar
      v-if="name == '预约信息'"
      :title="name"
      left-arrow
      @click-left="goHome"
      :fixed="true"
    >
      <template #left>
        <van-icon color="#606266" name="wap-home" size="30" />
      </template>
    </van-nav-bar> -->
    <!-- <van-nav-bar
      size="30"
      :title="name"
      left-arrow
      :fixed="true"
      @click-left="SY"
      v-if="name == '上门保洁'"
    >
    </van-nav-bar> -->
    <van-nav-bar
      size="30"
      v-else
      :title="name"
      left-arrow
      :fixed="true"
      @click-left="onClickLeft"
    />
  </div>
  <!--  -->
</template>

<script>
export default {
  props: {
    name: String,
  },
  methods: {
    onClickLeft() {
     this.$router.go(-1)
    },
    goHome() {
      this.$router.push({
        name: "rvicsharedstation-index",
        query: {
          id: 0,
        },
      });
      // router.push("/life/index");
    },
    SY() {
      // this.$router.push({
      //   name: "rvicsharedstation-index",
      //   query: {
      //     id: 0,
      //   },
      // });
    },
  },
};
</script>
<style>
.van-nav-bar {
  position: sticky;
  top: 0;
}
</style>
<style lang="less" scoped>
.titletopXX {
  height: 45px;
}
</style>